<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>蚩尤后裔</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.6.0/dist/css/bootstrap.min.css"
          integrity="sha384-B0vP5xmATw1+K9KRQjQERJvTumQW0nPEzvF6L/Z6nronJ3oUOFUFpCjEUQouq2+l" crossorigin="anonymous">
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("#userSubmit1").on("click", function () {
                var content = $("#content1").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg1").attr("src", "/code/qrCode1?codeContent=" + content);
            });

            $("#userSubmit1_2").on("click", function () {
                var content = $("#content1_2").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg1_2").attr("src", "/code/qrCode1_2?codeContent=" + content);
            });

            $("#userSubmit2").on("click", function () {
                var content = $("#content2").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg2").attr("src", "/code/qrCode2?codeContent=" + content);
            });

            $("#userSubmit3").on("click", function () {
                var content = $("#content3").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg3").attr("src", "/code/qrCode3?codeContent=" + content);
            });

            $("#userSubmit4").on("click", function () {
                var content = $("#content4").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg4").attr("src", "/code/qrCode4?codeContent=" + content);
            });

            $("#userSubmit5").on("click", function () {
                var content = $("#content5").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $("#codeImg5").attr("src", "/code/qrCode5?codeContent=" + content);
            });

            $("#userSubmit6").on("click", function () {
                var content = $("#content6").val();
                if (content == null || content == "" || content.length <= 0) {
                    return;
                }
                $.ajax({
                    url: "/code/qrCode6",
                    type: "GET",
                    data: {"codeContent": content},
                    dataType: "text",
                    cache: false,
                    success: function (data) {
                        $("#codeImg6").attr("src", data);
                    },
                    error: function (data) {
                        console.log(data);
                    }
                });
            });
        });
    </script>

</head>
<body style="width: 600px;margin-left: 200px">
<h5>蚩尤后裔</h5>

<img src="/code/qrCode1?codeContent=蚩尤后裔" id="codeImg1">
<textarea class="form-control" style="width: 300px" id="content1" rows="3"></textarea>
<button type="button" id="userSubmit1" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">最简单二维码1</span>
<hr/>

<img src="/code/qrCode1_2?codeContent=蚩尤后裔" id="codeImg1_2">
<textarea class="form-control" style="width: 300px" id="content1_2" rows="3"></textarea>
<button type="button" id="userSubmit1_2" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">最简单二维码2</span>
<hr/>

<img src="/code/qrCode2?codeContent=蚩尤后裔" id="codeImg2">
<textarea class="form-control" style="width: 300px" id="content2" rows="3"></textarea>
<button type="button" id="userSubmit2" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">带样式的二维码</span>
<hr/>

<img src="/code/qrCode3?codeContent=18673886412452125" style="width: 300px;height: 100px" id="codeImg3">
<textarea class="form-control" style="width: 300px" id="content3" rows="3"></textarea>
<button type="button" id="userSubmit3" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">生成条形码，注意条形码不支持中文！</span>
<hr/>

<img src="/code/qrCode4?codeContent=18673886412452125" style="width: 300px;height: 100px" id="codeImg4">
<textarea class="form-control" style="width: 300px" id="content4" rows="3"></textarea>
<button type="button" id="userSubmit4" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">生成条形码，注意条形码不支持中文！</span>
<hr/>

<img src="/code/qrCode5?codeContent=18673886412452125" id="codeImg5">
<textarea class="form-control" style="width: 300px" id="content5" rows="3"></textarea>
<button type="button" id="userSubmit5" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">二维码文件同时存储在桌面！</span>
<hr/>


<!--图片使用 Base64 数据格式：编码的图片数据；图片格式可以是常见的 gif、png、jpeg、x-icon 等等-->
<img src=""
     id="codeImg6">
<textarea class="form-control" style="width: 300px" id="content6" rows="3"></textarea>
<button type="button" id="userSubmit6" class="btn btn-primary">提 交</button>
<span style="margin-left: 10px;color: red">图片使用 base64 数据格式！</span>


</body>
</html>